﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Base.Data.Migrations
{
    public partial class remove_t_certificate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "t_certificate");

            migrationBuilder.AddColumn<string>(
                name: "agency",
                table: "t_user_certificate",
                type: "character varying(100)",
                maxLength: 100,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "code",
                table: "t_user_certificate",
                type: "character varying(30)",
                maxLength: 30,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "name",
                table: "t_user_certificate",
                type: "character varying(60)",
                maxLength: 60,
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "agency",
                table: "t_user_certificate");

            migrationBuilder.DropColumn(
                name: "code",
                table: "t_user_certificate");

            migrationBuilder.DropColumn(
                name: "name",
                table: "t_user_certificate");

            migrationBuilder.CreateTable(
                name: "t_certificate",
                columns: table => new
                {
                    id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
                    agency = table.Column<string>(type: "character varying(600)", maxLength: 600, nullable: true),
                    certificate_type_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    code = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: true),
                    create_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    is_deleted = table.Column<bool>(type: "boolean", nullable: false),
                    modify_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    name = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: true),
                    org_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
                    row_version = table.Column<int>(type: "integer", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_t_certificate", x => x.id);
                });

            migrationBuilder.CreateIndex(
                name: "IX_t_certificate_create_time",
                table: "t_certificate",
                column: "create_time");
        }
    }
}
